<template>
  <div class="Top" style="border-bottom: 1px solid rgba(0,0,0,.1);">
    <div class="publicCenter">
      <a  href="/" >
        <img src="http://static.kayisu.com/Uploads/KAYISU/10561/2020-07-20/5f15700f0f023.png" alt="网站logo图片" title="" class="logoimg" style="margin-top: 0;">
      </a>
      <div class="publicLogoY">|  专业的游戏服务平台</div>
      <ul class="publicNav">
        <li class="publicNavTxt"><a href="/notice" title="公告中心">公告中心</a></li>
        <li class="publicNavTxt"><a href="/register" title="用户注册">用户注册</a></li>
        <li class="publicNavTxt"><a href="/" title="首页">首页</a></li>
      </ul>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  props: {
    title: {
      type: String,
      default: '',
    },
  },
  data() {
    let idx = -1
    if (this.$route.name === 'themes') {
      // idx = 0
    } else if (this.$route.name === 'register') {
      idx = 1
    } else if (~this.$route.name.indexOf('notice')) {
      idx = 2
    }
    let This = this;
    setTimeout(function(){
      console.log(This.$data.linkMenuDataTop);
      for (let i = 0;i < 6; i++){
        This.$data.linkMenuDataTop.push({
          menuLink: "javascript:void(0)",
          menuName: "zheng",
          menuTips: "zhengxiya",
        })}
    },1000)
    return {
      idx,
      linkMenuDataTop: [],
    }
  },
  created() {
    this.getLinkMenuList()
  },
  computed: {
    ...mapState({
      site: (state) => state.site,
      systemStyle: (state) => state.systemStyle,
    }),
  },
  methods: {
    loginBoxShow(){
      this.$emit("listenToChildEvent",this.$refs.showBox);
    },
    showMoreBaiduLink(){
      this.$emit("listenToChildEvent1",this.$data.linkMenuDataTop);
    },
    setHomePage() {},
    addToFav() {},
    async getLinkMenuList() {
      let that = this
      const res = await this.$axios.get('/site/customMenu/listForDomain')
      if (res.code === 1001) {
        if (res.body) {
          that.linkMenuDataTop = res.body
        }
      }
    }
  },
}
</script>

<style lang="scss" scoped>
.Top {
  position: relative;
  z-index: 9;
  height: 86px !important;
}
.Top{width:100%;height:80px;background:#fff; }
.Top .publicCenter{width:1180px;height:50px;margin:0px auto;padding:15px 10px;background:#fff; }
.publicCenter .publicLogo{width:130px;display:inline-block;float:left;}
.publicCenter .publicLogo img{width:100%;}
.publicCenter .publicLogoY{width:280px;padding:0 5px;margin-top:20px;float:left;height:30px;line-height:30px;text-align:left;font-size:14px;color:#666;}
.publicCenter .publicNav{width:50%;float:right;margin-top:20px;height:30px;}
.publicNav .publicNavTxt{display:inline-block;float:right;height:30px;}
.publicNav .publicNavTxt a{display:inline-block;height:30px;line-height:30px;padding:0 15px;color:#666;font-size:14px;}
.logoimg{
  position: relative;
  float: left;
  width: 180px;
  height: 60px;
  margin-top: 10px;
  margin-right: 20px;
}
</style>
